//
// Created by hy on 2018/8/18.
//

#ifndef JNI_HITIME_H
#define JNI_HITIME_H

#include <sys/time.h>
#include "stdint.h"

class HiTime {
public:
    void start();
    void restart();
    void stop();
    bool started();
    uint64_t elapsed_ms() const;  //返回值是毫秒
    uint64_t elapsed_us() const;  //返回值是毫秒
    uint64_t elapsed_s() const;  //返回值是秒
    HiTime();
private:
    bool m_started = false;
    timeval m_preTime = {0};
};


#endif //JNI_HITIME_H
